<?php
// +----------------------------------------------------------------------
// | Author: wyd 2025/10/26
// | DESC: 
// +----------------------------------------------------------------------

declare (strict_types=1);


namespace My\core\frame;

class FileHelper
{
    public static function getFileMd5(string $dir, string $ignore)
    {
        $files = glob($dir);
        $res = [];
        foreach ($files as $file) {
            if (is_dir($file) && strpos($file, $ignore) === false) {
                $res[] = self::getFileMd5($file . '/*', $ignore);
            } else if (is_file($file) && pathinfo($file)['extension'] == 'php') {
                $res[] = md5_file($file);
            }
        }
        return md5(implode('', $res));
    }
}